package HomeWork;

import java.util.ArrayList;
import java.util.Iterator;

public class Test1 {
    public static void main(String[] args) {
        ArrayList<String> s = new ArrayList<>();
        s.add("JavaEE企业级开发指南");
        s.add("JOracle高级编程");
        s.add("MySQL从入门到精通");
        s.add("Java架构师之路");
        s.add("Oracle");
        Iterator<String> iterator = s.iterator();
        while (iterator.hasNext()){
            String next = iterator.next();
            System.out.println(next);

        }
        System.out.println("-------------");
        Iterator<String> iterator1 = s.iterator();
        while (iterator1.hasNext()){
            String next = iterator1.next();
            if (next.length()<10){
                System.out.println(next);
            }
        }

        System.out.println("--------------");
        Iterator<String> iterator2 = s.iterator();
        while(iterator2.hasNext()){
            String next = iterator2.next();
            if (next.contains("Java")){
                System.out.println(next);
            }
        }


        System.out.println("---------------");
        Iterator<String> it = s.iterator();
        while (it.hasNext()) {
            String a = it.next();
            if (a.contains("Oracle")) {
                it.remove();
            }
        }
        System.out.println(s);
        }
    }

